/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 容器样式 */
.container {
    background: white;
    border-radius: 15px;
    padding: 25px;
    width: 350px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
}

/* 标题样式 */
h1 {
    text-align: center;
    color: #333;
    margin-bottom: 20px;
    font-size: 24px;
    font-weight: 600;
}

/* 输入区域样式 */
.input-section {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    color: #555;
    font-weight: 500;
    font-size: 14px;
}

input[type="text"] {
    width: 70%;
    padding: 10px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 按钮样式 */
button {
    padding: 10px 15px;
    margin-left: 5px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

button:active {
    transform: translateY(0);
}

/* 颜色预览区域 */
.color-preview {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e9ecef;
}

#color-block {
    width: 100%;
    height: 80px;
    border-radius: 8px;
    border: 2px solid #dee2e6;
    margin-bottom: 15px;
    background: #f50000;
    transition: all 0.3s ease;
}

/* 颜色信息显示 */
.color-info {
    display: grid;
    gap: 8px;
}

.color-info div {
    padding: 8px 12px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: #495057;
    font-weight: 500;
}

/* 错误提示弹层样式 */
.error {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #ff4757;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(255, 71, 87, 0.3);
    z-index: 1000;
    animation: slideDown 0.3s ease;
    max-width: 300px;
    text-align: center;
}

.hidden {
    display: none;
}

/* 错误提示动画 */
@keyframes slideDown {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    100% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* 清除按钮样式 */
.clear-button {
    width: 100%;
    margin: 15px 0 0 0;
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    padding: 12px;
    font-size: 16px;
}

.clear-button:hover {
    background: linear-gradient(135deg, #5a6268 0%, #343a40 100%);
}

/* 响应式设计 */
@media (max-width: 400px) {
    .container {
        width: 300px;
        padding: 20px;
    }
    
    input[type="text"] {
        width: 65%;
    }
    
    button {
        padding: 8px 12px;
        font-size: 12px;
    }
}

/* 动画效果 */
@keyframes colorChange {
    0% { opacity: 0; transform: scale(0.9); }
    100% { opacity: 1; transform: scale(1); }
}

.color-updated {
    animation: colorChange 0.3s ease;
}